<ion-header>
  <ion-toolbar color="primary">
    <ion-navbar>
      <ion-row>
        <ion-title>离线数据</ion-title>
        <div (click)="logIn()" ion-button color="light" clear>
          <ion-icon name="log-in"></ion-icon>&nbsp;
          在线登录
        </div>
      </ion-row>
    </ion-navbar>
  </ion-toolbar>
</ion-header>


<ion-content class="list-avatar-page">
  <ion-list>
    <ion-list-header>时间选择</ion-list-header>
    <ion-item>
      <ion-label>开始时间</ion-label>
      <ion-datetime displayFormat="YYYY-MM-DD HH:mm" min="{{MINyear}}" max="{{MAXyear}}"
      cancelText="取消"    doneText="确定"         [(ngModel)]="MINdate"></ion-datetime>
    </ion-item>
    <ion-item>
      <ion-label>结束时间</ion-label>
      <ion-datetime displayFormat="YYYY-MM-DD HH:mm" min="{{MINyear}}" max="{{MAXyear}}"
      cancelText="取消"    doneText="确定"              [(ngModel)]="MAXdate"></ion-datetime>
    </ion-item>
    <button ion-button full clear (click)="timeSearch()">时间检索</button>
  </ion-list>

  <ion-list *ngIf="!isEmpty(loadOrUnloadList)" >
    <ion-list-header  >
      装货卸货
      <button ion-button icon-only item-end clear   (click)="selectAll('loadOrUnload')" >
        <ion-icon name="done-all"></ion-icon>&nbsp;
        全选
      </button>
    </ion-list-header>
    <ion-item *ngFor="let item of loadOrUnloadList">
      <ion-thumbnail item-start>
        <img src="{{item.img}}">
      </ion-thumbnail>
      <ion-label>{{item.date}}<p>容器：{{item.containerName}}&nbsp;{{item.containerCode}}</p><p> 货物：{{item.materielName}}&nbsp;{{item.materielCode}}</p></ion-label>
      <ion-checkbox color="dark" [(ngModel)]="item.check" item-end></ion-checkbox>
    </ion-item>
  </ion-list>


  <ion-list  *ngIf="!isEmpty(ruleRecordList)" >
    <ion-list-header>
      打尺检验
      <button ion-button icon-only item-end clear  (click)="selectAll('ruleRecord')">
        <ion-icon name="done-all"></ion-icon>&nbsp;
        全选
      </button>
    </ion-list-header>

    <ion-item *ngFor="let item of ruleRecordList">
      <ion-thumbnail item-start>
        <img src="{{item.img}}">
      </ion-thumbnail>
      <ion-label>{{item.date}}&nbsp;{{item.materiel}}<p>长(cm):{{item.length}}&nbsp;宽(cm):{{item.width}}</p><p>高(cm):{{item.height}}&nbsp;重量(kg):{{item.weight}}</p></ion-label>
      <ion-checkbox color="dark" [(ngModel)]="item.check" item-end></ion-checkbox>
    </ion-item>
  </ion-list>

  <ion-list *ngIf="!isEmpty(exceptionInfoList)">
    <ion-list-header >
      异常上报
      <button ion-button icon-only item-end clear   (click)="selectAll('exceptionReport')">
        <ion-icon name="done-all"></ion-icon>&nbsp;
        全选
      </button>
    </ion-list-header>

    <ion-item ion-item    *ngFor="let item of exceptionInfoList">
      <ion-label>{{item.date}} <p>{{item.text}} </p></ion-label>
      <ion-checkbox color="dark" [(ngModel)]="item.check" item-end></ion-checkbox>
    </ion-item>

  </ion-list>

</ion-content>


<ion-footer>
  <ion-row>
    <ion-col col-6>
      <button ion-button full (click)="goDataUpload()"  [disabled]="isEmpty(loadOrUnloadList)&&isEmpty(ruleRecordList)&&isEmpty(exceptionInfoList)" >
        确认
      </button>
    </ion-col>
    <ion-col col-6>
      <button ion-button full color="light" (click)="goBack()">返回</button>
    </ion-col>
  </ion-row>
</ion-footer>
